package com.zhoug.chart3.core.styleconfig;

import com.zhoug.chart3.MPChartColors;
import com.zhoug.chart3.utils.MPChartUtils;

/**
 * @Author: zhoug
 * @Date: 2024-02-04
 * @Description:
 */
public class MPLineStyleConfig extends MPStyleConfig implements IMPLineStyleConfig {
    private int[] lineColors;//曲线图颜色
    private boolean lineAttachAxis;

    @Override
    public void setLineColors(int[] lineColors) {
        this.lineColors = lineColors;
    }

    @Override
    public int[] getLineColors() {
        if (lineColors == null || lineColors.length == 0) {
            lineColors = MPChartColors.COLORS;
        }
        return lineColors;
    }


    @Override
    public int getLineColor(int index) {
        return MPChartUtils.getColorForIndex(getLineColors(), index);
    }

    @Override
    public void setLineAttachAxis(boolean attachAxis) {
        this.lineAttachAxis=attachAxis;
    }

    @Override
    public boolean isLineAttachAxis() {
        return lineAttachAxis;
    }
}
